//
//  BankListVC.m
//  EJLX
//
//  Created by adc on 15/11/26.
//  Copyright © 2015年 江苏一键联信息科技有限公司. All rights reserved.
//

#import "BankListVC.h"

@interface BankListVC ()

@end

@implementation BankListVC
-(void)viewWillAppear:(BOOL)animated{
    [HttpsManager banklist:^(NSArray *bankArray) {
        self.bankListArr = bankArray;
        [_tableViewBank reloadData];
    }];
    
    
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.view.alpha = 0.7;
    _tableViewBank.showsHorizontalScrollIndicator = NO;
    _tableViewBank.showsVerticalScrollIndicator = NO;
    _tableViewBank.backgroundColor = [UIColor whiteColor];
    
    

}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.bankListArr.count;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
      
    }
    BankList *b = self.bankListArr[indexPath.row];
    cell.textLabel.text = b.name;
    return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    BankList *b = self.bankListArr[indexPath.row];
   // NSString *name = b.name;
//    PostImageOfPersonCardVC *card = (PostImageOfPersonCardVC *)self.presentingViewController;
//    card.bankListName = [NSString stringWithFormat:@"%@",b.name];
//    NSLog(@"bank %@",card.bankListName);
    if ([self.delegate respondsToSelector:@selector(getBankName:andCode:)]) {
            [self.delegate getBankName:b.name andCode:b.code];
    }
 [self dismissViewControllerAnimated:YES completion:nil];
    
   }





- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.

}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
